package com.woniuxy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.entity.ModelItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ModelItemMapper extends BaseMapper<ModelItem> {
    /**
    * @description: 根据模型ID获取模型详情
     * @param id:
     * @return: java.util.List<com.woniuxy.entity.ModelItem>
     * @date: 2021/8/18 16:36
     * @author: 魏炳豪
     */
    @Select("SELECT * FROM gfr_model_Item WHERE model_id=#{id}")
    List<ModelItem> getByModelId(int id);
    /**
    * @description: 根据模型id删除模型详情
     * @param id:
     * @return: void
     * @date: 2021/8/18 17:23
     * @author: 魏炳豪
     */
    @Delete("delete from gfr_model_item where model_id=#{id}")
    void deleteByModelId(int id);

    /**
     * 获取所有的模型详情
     * @return
     */
    @Select("select * from gfr_model_item")
    List<ModelItem> getAll();


}
